package com.stone.serverless.web.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description: TODO
 * @Author: MECHREVO
 * @Date: 2022/1/23 17:24
 * @Version: 1.0.0
 */
@Getter
@Setter
public class RouterInfo {
    private List<ServerlessClassRequestMappingInfo> requestMappingInfo = new ArrayList<>();

    private String componentName;

    private String version;

    //public static Object copy(Object source, Object target, Class<?> classMapping, Class<?> methodMapping) {
    //
    //
    //
    //    ReflectUtil.setFieldValue(target, "componentName", ReflectUtil.getFieldValue(source, "componentName"));
    //    ReflectUtil.setFieldValue(target, "version", ReflectUtil.getFieldValue(source, "version"));
    //
    //    List sourceReq = (List) ReflectUtil.getFieldValue(source, "requestMappingInfo");
    //
    //    List targetReq = (List) ReflectUtil.getFieldValue(target, "requestMappingInfo");
    //
    //    for (Object so : sourceReq) {
    //        Object o = ReflectUtil.newInstance(classMapping);
    //        ServerlessClassRequestMappingInfo.copy(so, o, methodMapping);
    //        targetReq.add(o);
    //    }
    //    return target;
    //}
}
